-- GENERATED SPELL FOR [Scarlet Archmage] --


function spell0_9451(pUnit, Event) --@Cone of Cold,Self--
pUnit:FullCastSpellOnTarget(15244,pUnit)
pUnit:RegisterEvent('Sorts_9451', 8290, 1)
end

function spell1_9451(pUnit, Event) --@Counterspell,n/a--
pUnit:FullCastSpellOnTarget(15122,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_9451', 15322, 1)
end

function spell2_9451(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(15242,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_9451', 3000, 1)
end

function spell3_9451(pUnit, Event) --@Frost Armor,Self--
pUnit:FullCastSpellOnTarget(18100,pUnit)
pUnit:RegisterEvent('Sorts_9451', 0, 1)
end

function Sorts_9451(pUnit, Event)
local choix_sorts_9451 = math.random(0, 3)
if choix_sorts_9451 == 0 then
pUnit:RegisterEvent('spell0_9451', 1, 1)
end
if choix_sorts_9451 == 1 then
pUnit:RegisterEvent('spell1_9451', 1, 1)
end
if choix_sorts_9451 == 2 then
pUnit:RegisterEvent('spell2_9451', 1, 1)
end
if choix_sorts_9451 == 3 then
pUnit:RegisterEvent('spell3_9451', 1, 1)
end
end

function mob9451_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_9451', math.random(1500, 3000), 1)
end

function mob9451_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob9451_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob9451_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(9451, 1, 'mob9451_Action')
RegisterUnitEvent(9451, 2, 'mob9451_Leave')
RegisterUnitEvent(9451, 3, 'mob9451_Kill')
RegisterUnitEvent(9451, 4, 'mob9451_Die')
